package com.yl.ylnews.base;

import android.app.Activity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.TextView;

import com.yl.ylnews.MainActivity;
import com.yl.ylnews.R;

/**
 * Created by Administrator on 2016/10/17 0017.
 */

public class BaseViewPager {
    public Activity mActivity;
    public ImageButton btn_menu;
    public TextView tv_tittle;
    public FrameLayout fl_content;
    public final View mView;

    public BaseViewPager(Activity mActivity) {
        this.mActivity = mActivity;
        mView = initView();
    }

    public View initView() {
        View view = View.inflate(mActivity.getApplication(), R.layout.base_pager,null);
        btn_menu = (ImageButton) view.findViewById(R.id.btn_menu);
        tv_tittle = (TextView) view.findViewById(R.id.tv_tittle);
        fl_content = (FrameLayout) view.findViewById(R.id.fl_content);
        btn_menu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                MainActivity maiUI = (MainActivity) mActivity;
                maiUI.getSlidingMenu().toggle();
            }
        });
        return view;
    }
    //让子类实现
    public void initData(){

    }

}
